import { CardsHeap } from "@/core/cardsystem/cardHeap";
import { GameManager } from "../gameManager";
import { Sha, Shan } from "@/core/cardsystem/basicCard";
import { Color } from "@/core/cardsystem/card";


/**
 * 本类仅用于开发过程中测试
 */
export class GameManagerTester extends GameManager {

    dispatchCard() {
        this.shauseTest()

        super.dispatchCard()
    }

    shauseTest() {
        class CardsHeapTester extends CardsHeap {

            cardHeap: CardsHeap

            constructor(cardHeap: CardsHeap) {
                super()
                this.cardHeap = cardHeap
            }

            initCards(): void {
                this.addCards(Sha, Color.DIAMOND, 6, 7, 8, 9)
                this.addCards(Sha, Color.DIAMOND, 6, 7, 8, 9)
                this.addCards(Sha, Color.DIAMOND, 6, 7, 8, 9)
                this.addCards(Sha, Color.DIAMOND, 6, 7, 8, 9)
                this.addCards(Shan, Color.DIAMOND, 6, 7, 8, 9)
                this.inuseCards = [...this.allCards]
            }

        }

        this.cardHeap = new CardsHeapTester(this.cardHeap)

    }

    static create(): GameManager {
        
        const gameManager : GameManager = new GameManagerTester()
        gameManager.updateView()
        return gameManager
    }

}
